import Axios from "../../lib/request";

// 查询优惠券类活动列表  
export const getcouponLists = function (data) {
    return Axios.post("/coupon/list",data);
};
//添加优惠券活动
export const couponAdd = function (data) {
    return Axios.post("/coupon/add", data);
};
//优惠券详情
export const couponDetail = function (data) {
    return Axios.post("/coupon/show", data);
};
//修改优惠券活动
export const couponUpdate = function (data) {
    return Axios.post(`/coupon/update`, data);
};
//删除优惠券活动
export const couponDelete = function (id) {
    return Axios.get(`/coupon/isOpen/?id=${id}`);
};
//优惠券活动是否开启
export const couponisOpen = function (data) {
    return Axios.post(`/coupon/isOpen`, data);
};
//优惠券商品列表
export const coupongoodList = function (data) {
    return Axios.post(`/coupon/shopList`, data);
};
//商品列表
export const goodList = function (data) {
    return Axios.post(`/tbSpu/activitySpuList`, data);
};
//一级类目
export const firstGood = function () {
    return Axios.get(`/category/list1`);
};
//二级类目
export const secondGood = function (id) {
    return Axios.get(`/category/list2/?id=${id}`);
};

//查询秒杀活动列表  
export const getseckillLists = function (data) {
    return Axios.post("/seckill/list",data);
};
//添加秒杀活动
export const seckillAdd = function (data) {
    return Axios.post("/seckill/add", data);
};
//秒杀详情
export const seckillDetail = function (data) {
    return Axios.post(`/seckill/show`,data);
};
//修改秒杀活动
export const seckillUpdate = function (data) {
    return Axios.post(`/seckill/update`, data);
};
//删除秒杀活动
export const seckillDelete = function (id) {
    return Axios.get(`/seckill/isOpen?id=${id}`);
};

////查询拼团活动列表  
export const getgroupActivitiesList = function (data) {
    return Axios.post("/groupActivities/getgroupActivitiesList",data);
};
//添加拼团活动
export const addGroupActivities = function (data) {
    return Axios.post("/groupActivities/addGroupActivities", data);
};
//拼团详情
export const groupDetail = function (data) {
    return Axios.post(`/groupActivities/detail`,data);
};
//修改拼团活动
export const updateGroupActivities = function (data) {
    return Axios.post(`/groupActivities/updateGroupActivities`, data);
};
//删除拼团活动
export const groupDelete = function (id) {
    return Axios.get(`/groupActivities/delete?id=${id}`);
};


////查询打包活动列表  
export const getsetMealList = function (data) {
    return Axios.post("/setMeal/getsetMealList",data);
};
//添加打包活动
export const addSetMeal = function (data) {
    return Axios.post("/setMeal/addSetMeal", data);
};
//打包详情
export const setMealDetail = function (data) {
    return Axios.post(`/setMeal/detail`,data);
};
//修改打包活动
export const updateSetMeal = function (data) {
    return Axios.post(`/setMeal/updateSetMeal`, data);
};
//删除打包活动
export const setMealDelete = function (id) {
    return Axios.get(`/setMeal/delete?id=${id}`);
};


////查询抽奖活动列表  
export const findLotteryList = function (data) {
    return Axios.post("/lotteryTurntable/findLotteryList",data);
};
//添加抽奖活动
export const insterLottery = function (data) {
    return Axios.post("/lotteryTurntable/insterLottery", data);
};
//抽奖详情
export const lotteryDetils = function (id) {
    return Axios.get(`/lotteryTurntable/lotteryDetils?id=${id}`);
};
//修改抽奖活动
export const updateLottery = function (data) {
    return Axios.post(`/lotteryTurntable/updateLottery`, data);
};
//开启抽奖活动
export const lotteryTurntableOpenStatus = function (id) {
    return Axios.get(`/lotteryTurntable/openStatus?id=${id}`);
};
//关闭抽奖活动
export const lotteryTurntableCloseStatus = function (id) {
    return Axios.get(`/lotteryTurntable/closeStatus?id=${id}`);
};
//删除抽奖活动
export const delLottery = function (id) {
    return Axios.get(`/lotteryTurntable/delLottery?id=${id}`);
};

//抽奖活动优惠券和商品列表
export const lotteryTurntableList = function (id) {
    return Axios.get(`/lotteryTurntable/list?id=${id}`);
};

////查询商盟活动列表  
export const selectCPAll = function (data) {
    return Axios.post("/coalitionactivity/selectCPAll",data);
};
////查询商盟活动列表  
export const tActivitySelectCPAll = function (data) {
    return Axios.post("/tActivity/selectCPAll",data);
};

////报名商盟活动
export const insertCy = function (data) {
    return Axios.post("/coalitionactivity/insertCy",data);
};

//重新报名
export const coalitionactivityUpdateStatus = function (id) {
    return Axios.get(`/coalitionactivity/updateStatus?id=${id}`);
};

//报名商品列表
export const tbSpuSelectTNS = function (data) {
    return Axios.post("/tbSpu/selectTNS",data);
};

//商品树
export const activitySpuTree = function (data) {
    return Axios.post("/tbSpu/activitySpuTree",data);
};


